home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15137 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  747 b 

  1. Path: user1.mnsinc.com!huang
  2. From: huang@mnsinc.com (Szu-Wen Huang)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: printf problems..
  5. Date: 17 Apr 1996 12:34:55 GMT
  6. Organization: Monumental Network Systems
  7. Message-ID: <4l2ohl$t54@news1.mnsinc.com>
  8. References: <4l1ubi$c3p@news.ysu.edu>
  9. NNTP-Posting-Host: user1.mnsinc.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Brian T. Richardson (bi287@yfn.ysu.edu) wrote:
  13.  
  14. :     I want it to output '02.11' not '2.11'  
  15.  
  16. :     I tried something like printf(temp, "%O2.2f", myvar)
  17. :     and other varations and nothing has worked for
  18. :     me, I know I'm missing something really obvious..
  19.  
  20. Yes, you certainly missed reading the manual ;).  Try "%05.2f" as a
  21. format string, then by all means find out why 5 would work but 2
  22. won't.  Hth.
  23.